﻿
using zijian666.Converts.Abstractions;

namespace zijian666.Converts.Core;

/// <summary>
/// 已匹配的转换器
/// </summary>
/// <typeparam name="T">转换器转换的类型</typeparam>
/// <param name="convertor">转换器</param>
/// <param name="macthedType">匹配类型</param>
public readonly struct MatchedConvertor<T>(IConvertor<T> convertor, MacthedType macthedType)
{
    /// <summary>
    /// 匹配类型
    /// </summary>
    public MacthedType MacthedType { get; } = macthedType;

    /// <summary>
    /// 匹配的转换器
    /// </summary>
    public IConvertor<T> Convertor { get; } = convertor ?? throw new System.ArgumentNullException(nameof(convertor));
}